<include file="__PUBLIC__/header"/>
<div class="page-container">
    <!--菜单-->
    <div class="cl pd-5 bg-1 bk-gray mt-10 mb-10">
        <span class="l">
            <a href="javascript:;" onclick="qz_layer_open('新增字段','{|U:'add',array('mid'=>$_GET['mid'])}')" class="btn btn-primary radius"><i class="Hui-iconfont">&#xe600;</i> 新增字段</a>
            <a href="javascript:;" onclick="ajax_req('{|U:'updateCache',array('mid'=>$_GET['mid'])}')" class="btn btn-default radius ml-5"><i class="iconfont icon-qingchuhuancun"></i> 更新字段缓存</a>
        </span>
        <span class="r" style="line-height:1.6em;margin-top:3px"></span>
    </div>
    <!--列表-->
    <form class="form form-horizontal" id="form" action="{|U:'updateSort'}" method="post">
    <table class="table table-border table-bordered table-bg mt-10 table-sort" id="table">
        <thead>
        <tr class="text-c">
            <th>排序</th>
            <th>描述</th>
            <th>字段名</th>
            <th>表名</th>
            <th>类型</th>
            <th>系统</th>
            <th>必填</th>
            <th>搜索</th>
            <th>投稿</th>
            <th width="80">操作</th>
        </tr>
        </thead>
        <tbody>
        <list from="$field" name="$qz">
            <tr class="text-c">
                <td><input type="text" size="2" class="input-text" name="fieldsort[{$qz.fid}]" value="{$qz.fieldsort}"/></td>
                <td>{$qz.title}</td>
                <td>{$qz.field_name}</td>
                <td>{$qz.table_name}</td>
                <td>{$qz.field_type}</td>
                <td>
                    <if value="$qz.is_system">
                        <span class="c-red">√</span>
                        <else/>
                        <span class="c-blue">×</span>
                    </if>
                </td>
                <td>
                    <if value="$qz.required">
                        <span class="c-red">√</span>
                        <else/>
                        <span class="c-blue">×</span>
                    </if>
                </td>
                <td>
                    <if value="$qz.issearch">
                        <span class="c-red">√</span>
                        <else/>
                        <span class="c-blue">×</span>
                    </if>
                </td>
                <td>
                    <if value="$qz.isadd">
                        <span class="c-red">√</span>
                        <else/>
                        <span class="c-blue">×</span>
                    </if>
                </td>
                <td class="text-l">
                    <?php if (in_array($qz['field_name'], $noallowedit)) { ?>
                    <?php } else { ?>
                        <a title="编辑字段" href="javascript:;" onclick="qz_layer_open('编辑字段','{|U:'edit',array('mid'=>$qz['mid'],'fid'=>$qz['fid'])}')" class="label label-primary radius" ><i class="Hui-iconfont">&#xe6df;</i></a>
                    <?php } ?>
                    <?php if (in_array($qz['field_name'], $noallowforbidden)) { ?>
                    <?php } else if ($qz['status'] == 1) { ?>
                        <a title="禁用字段" href="javascript:ajax_req('{|U:forbidden}',{fid:{$qz.fid},status:0,mid:{$qz.mid}})" class="label label-warning radius"><i class="Hui-iconfont">&#xe631;</i></a>
                    <?php } else { ?>
                        <a title="启用字段" href="javascript:ajax_req('{|U:forbidden}',{fid:{$qz.fid},status:1,mid:{$qz.mid}})" class="label label-success radius"><i class="Hui-iconfont">&#xe615;</i></a>
                    <?php } ?>
                    <?php if (in_array($qz['field_name'], $noallowdelete)): ?>
                    <?php else: ?>
                        <a title="删除字段" href="javascript:;" onclick="del_forever(this,'{$qz['fid']}','{|U:'del'}')"
                           class="label label-danger radius" ><i class="Hui-iconfont">&#xe6e2;</i></a>
                    <?php endif; ?>
                </td>
            </tr>
        </list>
    </table>
        <br>
    <button type="submit" class="btn btn-primary radius"><i class="Hui-iconfont">&#xe675;</i> 排序</button>
    </form>
</div>
<include file="__PUBLIC__/footer"/>
<script>
    $(function () {
        //表单提交
        $("#form").Validform({
            tiptype: 2,
            ajaxPost: true,
            showAllError: true,
            callback: function (ret) {
                ajax_progress(ret);
            }
        });
    })
</script>
</body>
</html>